$(function(){
    var initScreen=function(callback){//初始化html  font-size
            //$("html").css("font-size",document.documentElement.clientHeight/document.documentElement.clientWidth<1.5 ? (document.documentElement.clientHeight/603*312.5+"%") : (document.documentElement.clientWidth/375*312.5+"%")); //单屏全屏布局时使用,短屏下自动缩放
            $("html").css("font-size",document.documentElement.clientWidth/375*312.5+"%");//长页面时使用,不缩放
            if(callback)callback();
        }
    initScreen(function(){
        //屏幕改变重置
        window.addEventListener("orientationchange" in window ? "orientationchange" : "resize",function(e){
            var st=setTimeout(initScreen,300);
        }, false);
        var w = $(window).width();
        //表情初始化
        console.log(w);
        $("#facebox").css({"width":w});
        $(".face-btn").qqFace({
            id : 'facebox', 
            assign:'saytext', 
            path:'arclist/' //表情存放的路径
        });
        function replace_em(str){
            str = str.replace(/\</g,'&lt;');
            str = str.replace(/\>/g,'&gt;');
            str = str.replace(/\n/g,'<br/>');
            str = str.replace(/\[em_([0-9]*)\]/g,'<img class="expression" src="arclist/$1.gif" border="0" />');
            return str;
        };
    });
})